home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 291_01 / jjbset.h < prev    next >
Text File  |  1989-06-26  |  9KB  |  162 lines

  1. /****************************************************************************
  2.  *                                                                          *
  3.  *                            jjbset.h                                      *
  4.  *                                                                          *
  5.  *   Copyright (c) 1988, 1989, JJB. All rights reserved.                    *
  6.  *                                                                          *
  7.  *   Purpose:                                                               *
  8.  *                                                                          *
  9.  *      The main reason for the get( and set( functions is to provide an    *
  10.  *      easy way to fetch and store integers and characters so they are     *
  11.  *      TRULY GLOBAL for all source and object files linked. Plus, using    *
  12.  *      arrays allows all variables to be initalized fast and easy.         *
  13.  *                                                                          *
  14.  *     JJB, 9236 church Rd suite 1082, Dallas, Tx 75231 (214) 341-1635      *
  15.  ****************************************************************************/
  16.  
  17. /*
  18. JJB has defined the following arrays as follows:
  19.  
  20.       #define IARRYSIZE  80;
  21.       #define CARRYSIZE  10;
  22.  
  23.        unsigned  int  iarry[IARRAYSIZE];
  24.        unsigned char  carry[CARRAYSIZE];
  25.  
  26.   The function jjb_initalize(), initalizes the integer and character
  27.   arrays to zero and initalizes some of the variables such as the
  28.  
  29. Prototypes:
  30.   unsigned int  get(int)           for the integer array
  31.   void set(int, int)
  32.   unsigned char getc(int)          for the character array
  33.   void setc(int,char)
  34. */
  35.  
  36. #ifndef IARRYSIZE
  37. #define IARRYSIZE      80
  38. #define IASIZE          0  /* holds size of the array.                    */
  39. #define VIDEOMODE       1  /* video mode of user of your program          */
  40. #define VATTRIB         2  /* the attribute used for all 'vf' functions   */
  41. #define VNCOLOR         3  /* the attribute set for your normal color     */
  42. #define VRCOLOR         4  /* the attribute set for your reverse color    */
  43. #define VUCOLOR         5  /* the attribute set for your underline color  */
  44. #define VICOLOR         6  /* the attribute set for your input color      */
  45. #define VNCOLORMENU     7  /* the normal attribute for pull-down menus    */
  46. #define VRCOLORMENU     8  /* the reverse attribute for pull-down menus   */
  47. #define VUCOLORMENU     9  /* the underline attribute for pull-down menus */
  48. #define VWCOLORMENU    10  /* the border attribute for pull-down windows  */
  49. #define VEXITATTRIB    11  /* attribute saved so exiting can use same     */
  50. #define VDOWN          12  /* number of rows to come down in 'vfsdo('     */
  51. #define VOVER          13  /* come over to this column for 'vfsdo('       */
  52. #define WROW           14  /* window row for last window made             */
  53. #define WCOL           15  /* window column for last window made          */
  54. #define WWIDTH         16  /* window width for last window made           */
  55. #define WDEPTH         17  /* window depth for last window made           */
  56.  
  57. #define IK_AL_REG      20  /* low byte reg of kbd interrupt in kbint()    */
  58. #define IK_AH_REG      21  /* high byte reg of kbd interrupt in kbint()   */
  59. #define IKEY           22  /* integer value of last keypress  KEY         */
  60. #define IKEYU          23  /* integer value of KEYU                       */
  61. #define IK_EXT         24  /* integer value of K_EXT                      */
  62. #define IK_CODE        25  /* integer value of keyboard scan code K_CODE  */
  63.  
  64. #define UPPER_SW       26   /* set T forces all keypresses to upper case. */
  65. #define VCLRW_SW       27   /* set T turns off big JJB window             */
  66. #define SHOWSETUP_SW   28   /* set T shows jjb_setup() on screen          */
  67. #define BEEPOFF_SW     29   /* set T turns off beep                       */
  68. #define HELPOFF_SW     30   /* set T turns off F1 help.                   */
  69. #define HEADINGOFF_SW  31   /* set T turns off heading row display        */
  70. #define BOTOFF_SW      32   /* set T turns off bottom row display         */
  71. #define ALTOFF_SW      33   /* set T turns off ALT key for opt selection  */
  72. #define ALTXOFF_SW     34   /* set T disables ALT X to exit to DOS        */
  73. #define ALTXSURE_SW    35   /* set T asks question before DOS exit        */
  74.  
  75. #define KBDDEL         40   /* number 1-255 to slow up store_keys(        */
  76. #define JDEL           41   /* value of last delay. jdelay(SAME) uses it. */
  77. #define INT_INPUTTED   42   /* number input_num( accepted                 */
  78. #define DEFAULTOPT     43   /* holds a number from 1 to 50 which refers
  79.                  to the default option. The default option is
  80.                  the option JJB will call when it completes
  81.                  the option it is executing. You may change
  82.                  this number from any function.             */
  83. /* internal JJB variable and switches for the enter( functions            */
  84. #define EPTR           44   /* enter pointer                              */
  85. #define ESTART         45   /* start with this pointer                    */
  86. #define EMAX           46   /* largest possible pointer for editing       */
  87. #define EDSP_SW        47   /* when set T, all enter functions display    */
  88.  
  89.  
  90. /****************************************************************************
  91.  *                                                                          *
  92.  *                     GET A CHARACTER FROM JJB                             *
  93.  *                     SET A CHARACTER IN JJB                               *
  94.  *                                                                          *
  95.  *   'getc( and setc( are the same as the integer function except they      *
  96.  *   fetch and store characters.                                            *
  97.  *                                                                          *
  98.  *   Do not confuse 'getc(KE)' with 'get_ch()'. The function get_ch() waits *
  99.  *   for a key to be pressed and then stores the values in the character    *
  100.  *   array under the definitions: KE, KEU, KEE and KCODE. get_ch() also     *
  101.  *   stores the integer equivalent in the integer arrays under the          *
  102.  *   definitions: IKE, IKEU, IKEE and IKCODE.                               *
  103.  *                                                                          *
  104.  *   char getc(int);          ex:  ch = getc(KE); reads last keypress       *
  105.  *   void setc(int,char);          setc(USERC1,ch); stores char in USERC1   *
  106.  *                                                                          *
  107.  ****************************************************************************/
  108.  
  109. #define CARRYSIZE  10   /* size of the character array */
  110. #define K_AL_REG   81   /* save low byte from last keyboard interrupt     */
  111. #define K_AH_REG   82   /* save high byte from last keyboard interrupt    */
  112. /* in kbint(), KEY   is made equal to K_AL_REG and
  113.          K_EXT is made equal to K_AH_REG                            */
  114. #define KEY        83   /* last keypress character                        */
  115. #define KEYU       84   /* last keypress taken to upper case              */
  116. #define K_EXT      85   /* if KEY= '\0', K_EXT hold byte of extention     */
  117. #define K_CODE     86   /* keyboard scan code                             */
  118. #define REMOVE     87   /* remove key for enter( functions  '*'           */
  119. /* Note: You may be thinking that KEY above should be defined as 1,
  120.    instead of 81. You are correct. However JJB has made it 81 for
  121.    a reason.
  122.  
  123.    The get( and set( functions check to make sure that the value being
  124.    sent to it is between 0 and 79. If not, an error message will occur.
  125.  
  126.    Therefore if you use 'get(KEY)' instead of the proper 'getc(KEY)',
  127.    JJB will catch your error.
  128.  
  129.    'getc(' and 'setc('  substracts 80 from the value being sent  to
  130.    it before it fetches or stores a character.
  131.  */
  132.  
  133. /* These are defined for the setting the color functions.                 */
  134.  
  135. #define BLACK   0
  136. #define BLUE    1
  137. #define GREEN   2
  138. #define